<template>
    <view class="page">
        <view v-html="userStatement"></view>
    </view>
</template>

<script>
    export default {
        name: "userStatement",
        data(){
            return{
                userStatement:''
            }
        },
        onShow(){
            this.getStatement();
        },
        methods:{
            //发布需求前获取服务条款
            async getStatement(){
                const res = await this.$api.getStatement();
                if (res.data.level == 'success'){
                    let str = res.data.data.content;
                    str = str.replace(/<img[^>]*>/gi, function (match, capture) {
                        return match.replace(/style\s*?=\s*?([‘"])[\s\S]*?\1/ig, '')
                    })
                    str = str.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');
                    this.userStatement = str;
                }
            },
        }
    }
</script>

<style scoped lang="scss">
    .page{
        padding: 30rpx;
    }
</style>